﻿using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ToolCollection
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Window_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
            {
                this.DragMove();
            }
        }

        private void ExitButton_Click(object sender, RoutedEventArgs e)
        {
            Application.Current.Shutdown();
        }

        private void MaxMin_Click(object sender, RoutedEventArgs e)
        {
            Button button = (Button)sender;
            Image myImage = new Image();
            switch (button.Name.ToString())
            {
                case "最大化":
                    this.WindowState = WindowState.Maximized;
                    myImage.Source = new BitmapImage(new Uri("./Assets/normal.png"));
                    button.Content = myImage;
                    button.Name = "还原";
                    break;
                case "还原":
                    this.WindowState = WindowState.Normal;
                    myImage.Source = new BitmapImage(new Uri("/Assets/max.png"));
                    button.Content = myImage;
                    button.Name = "最大化";
                    break;
                case "最小化":
                    this.WindowState = WindowState.Minimized; 
                    break;
            }
        }
    }
}